const app2 = new Vue({
    el: '#app1',
    data: {

    },
    created(){
        console.log("初始化")
        this.loading = true
        var token = localStorage.getItem('token')
        fetch('/user/auth', {
                    method:'POST',
                    headers:{
                        'Content-Type': 'application/x-www-form-urlencoded',
                        'token': token
                    },
                    body:``,
        })
        .then(resp => resp.json())
        .then(json => {
            if(json.code==200){
                console.log(1)
            }else{
                this.$alert(json.results.message, '警告', {
                    confirmButtonText: '确定',
                    callback: action => {
                        setTimeout(function(){
                            location.href = '/'
                        },100)
                    }
                });
            }
        })
    },
    methods:{
    }
});

